package com.crscd.kt.demo

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @since 2022-08-19 下午3:14
 */
fun main() {
    fun printDouble(d: Double) {println(d)}

    val i = 1
    val d = 1.1
    val f = 1.1f

    printDouble(d)

    val hexBytes = 0xFF_EC_DE_5E

    val a: Int = 10000
    println(a === a)
    val boxedA: Int? = a
    val anotherBoxedA: Int? = a
    // === 比较的是地址是否相同
    println(boxedA === anotherBoxedA)
    // == 比较的是值是否相同
    println(boxedA == anotherBoxedA)

    val x = 1.01
    val isInRange = x in 1.0..2.0
    val isNotInRange = x !in 0.0..1.0

    println(isInRange)
    println(isNotInRange)

    val arrayTemp = arrayOf(1,2,3)
    arrayTemp[0] = 0
    println(arrayTemp[0])
    println(arrayTemp.size)

    val text1 = """
        |Tell me and I forget.
        |Teach me and I remember.
        |Involve me and I learn.
        |(Benjamin Franklin)
    """.trimMargin()

    println(text1)

    val derived = Derived("kang", 1)
    derived.draw()
}